function unique_colorized,arr

arr_sort_index = SORT(arr)
original_index = indgen(N_ELEMENTS(arr))

arr_sort       = arr  (arr_sort_index)
original_index = SORT (arr_sort_index)

uniques= arr_sort(UNIQ(arr_sort))
uniques_n = N_ELEMENTS(uniques)

colors_uniq = 254*(findgen(uniques_n)/(uniques_n-1))

colors_arr = arr
  for i=0,uniques_n-1 do colors_arr(where(arr eq uniques(i)))=colors_uniq(i)

   return,colors_arr
end